﻿using ExampleService.Xxxxx.SDK.Contract;
using Microsoft.Extensions.DependencyInjection;
using System.Reflection;

namespace ExampleService.Xxxxx.SDK
{
    public static class HttpApiExtensions
    {
        public static void AddHttpApi(this IServiceCollection services, Type httpApiType, string host)
        {
            // 注册 契约接口 [业务接口]
            services.AddHttpApi(httpApiType, options =>
            {
                options.HttpHost = new Uri("http://localhost:5209");
            });

            //services.AddTokenProvider<AuthTokenProvider>(async provider =>
            //{
            //    var tokenProvider = new AuthTokenProvider(provider);
            //    tokenProvider.Name = httpApiType.Name; // 设置名称为接口名
            //    return await tokenProvider.GetTokenAsync();
            //}); 
        }


    }
}
